package com.julian.delegatePattern.rmi;

import java.rmi.Naming;
import java.rmi.registry.LocateRegistry;

public class MyRemoteServer {

    public static void main(String[] args) {
        try{
            // Create an object of the interface
            // implementation class
            MyRemote service = new MyRemoteImpl();

            // rmiregistry within the server JVM with
            // port number 1901
            LocateRegistry.createRegistry(1901);

            // Binds the remote object by the name
            //RemoteHello
            Naming.rebind("rmi://localhost:1901"+
                    "/RemoteHello",service);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
